package com.sneakxy.mybase4j.platform.service;

import com.alibaba.dubbo.config.annotation.Reference;

import com.sneakxy.mybase4j.base.service.BaseService;

import com.sneakxy.mybase4j.platform.beans.RolePerm;
import com.sneakxy.mybase4j.platform.beans.RolePermId;

import com.sneakxy.mybase4j.platform.provider.IRolePermProvider;

import com.sneakxy.mybase4j.platform.service.IRolePermService;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;

import org.springframework.stereotype.Service;

/**
 * 
 * @author 潜行的青衣
 * @see
 */
@Service
public class RolePermService extends BaseService<RolePerm, RolePermId, IRolePermProvider> implements IRolePermService {

	@Reference(version = "1.0.0")
	@Autowired(required = false)
	@Qualifier("rolePermProvider")
	private IRolePermProvider provider;

	@Override
	public IRolePermProvider getProvider() {
		return this.provider;
	}

	/* (non-Javadoc)
	 * @see com.sneakxy.mybase4j.platform.service.IRolePermService#findPermissions(java.util.List)
	 */
	@Override
	public List<String> findPermissions(List<String> roles) {
		return this.getProvider().findPermissions(roles);
	}

	/* (non-Javadoc)
	 * @see com.sneakxy.mybase4j.platform.service.IRolePermService#deleteByPermId(java.lang.String)
	 */
	@Override
	public int deleteByPermId(String permId) {
		return this.getProvider().deleteByPermId(permId);
	}

	/* (non-Javadoc)
	 * @see com.sneakxy.mybase4j.platform.service.IRolePermService#findPermissions(java.lang.String)
	 */
	@Override
	public List<String> findPermissions(String roleId) {
		return this.getProvider().findPermissions(roleId);
	}

	/* (non-Javadoc)
	 * @see com.sneakxy.mybase4j.platform.service.IRolePermService#deleteByRoleId(java.lang.String)
	 */
	@Override
	public int deleteByRoleId(String roleId) {
		return this.getProvider().deleteByRoleId(roleId);
	}

}
